<template>
    <div  class="imgdetail">
         <div class="desc-panel desc-panel-basic" style="height:100%">
             <div class="iframe-wrapper" style="height:100%;" @touch.stop.prevent="">
                <iframe frameborder="0" ref='Iframes' ></iframe>
                <!--  -->
            </div>
        </div>
    </div>
</template>   
<script>
import { imgdetail } from '../../../config/env'
    export default  {
      
        mounted(){
           this.$nextTick(function(){
                  this.$refs.Iframes.src = imgdetail+'/pds-web/product/graphicDetails/'+this.$route.params.supplierCode+'/'+this.$route.params.cmmdtyCode+'/10051.html'

                  $('.imgdetail').height($('.protool').offset().top - $('.imgdetail').offset().top)

                    $('.li_close a').click(function(){
                        setTimeout(() => {
                           $('.imgdetail').height($('.protool').offset().top - $('.imgdetail').offset().top)
                        },500)
                    })
            })
            
        },
        watch: {
            // $route(val, old){
            //     this.fn()
            // }
        },
        methods:{
            // fn(){
            //     var type = this.$route.params.type
            //     if(type == 'imgdetail'){

            //         this.$refs.Iframes.src = imgdetail+'/pds-web/product/graphicDetails/'+this.$route.params.supplierCode+'/'+this.$route.params.cmmdtyCode+'/10051.html'
            //      }
            //     if(type == 'aftermarket'){
                 
            //             this.$refs.Iframes.src = imgdetail+'/pds-web/product/graphicSaleApp/'+this.$route.params.supplierCode+'/'+this.$route.params.cmmdtyCode+'.html'
            //      }
            //      if(type == 'parameter') {
            //          this.$refs.Iframes.src = imgdetail+'/pds-web/product/graphicDetailsApp/'+this.$route.params.supplierCode+'/'+this.$route.params.cmmdtyCode+'/10051/R9000380/1.html'
            //      }
            //      this.$refs.Iframes.onload = function() {
            //         this.style.height = this.offsetHeight + 'px'
            //      }
            // }
        } 

    }
</script>
<style scoped>
    .imgdetail {
        height: 19rem;
    } 
    .desc-panel .iframe-wrapper iframe {
        width: 100%;
        height:100%;
        
    }
    
</style>